package com.llw.customdialogdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    private CustomDialog customDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    //出现
    public void show(View view) {
        customDialog = new CustomDialog(this);
        customDialog.show();
    }

    //隐藏
    public void hidden(View view) {
        if(customDialog == null)return;
        customDialog.dismiss();
    }
}
